package com.kehutong.house.entity;

import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.FilterAble;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.KeyType;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;
import org.coraframework.orm.util.IDType;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 小区信息表
 * 
 * @author qiaojunying
 * @date 2020-04-29
 */

@Table(value="t_community", multi=true, idType= IDType.TIMESTAMP,isSyncGenerateTable=true)
public class Community extends Entity implements FilterAble {

    private static final long serialVersionUID = 218626007273162091L;

    protected Community(String id){
        super(id);
    }

    // ----------------物业信息----------------
    @Column(comment = "所属部门编号")
    private String parent_id;

	@UnSave
	private String parent_name;
    
    @Column(comment = "所有所属部门编号", length=127)
    private List<String> parent_ids;

	@Column(comment = "管家编号")
	private List<String> employee_ids;

	@UnSave
	private List<String> employee_names;

	// ----------------基础信息----------------
    @Column(comment = "所在地区")
    private List<String> area_ids;
    
    @Column(comment = "所在地区名称", length=127)
    private List<String> area_names;

    @Column(length=64, comment = "小区名称")
    private String name;

	@Column(comment="别名")
	private String viewName;

	@Column(comment="详细地址")
	private String address;

	@Column(comment="楼栋数")
	private Integer buildNum;

	@Column(comment="总户数")
	private Integer familyNum;

	@Column(comment="停车位")
	private Integer parkNum;

	@Column(comment="商铺数")
	private Integer shopNum;

	// ----------------小区档案----------------
	@Column(comment="开发商")
	private String developer;

	@Column(comment="物业类别")
	private List<String> propertyType;

	@Column(comment="建筑类别")
	private List<String> buildType;

	@Column(comment = "装修状况")
	private String decorationDesc;

	@Column(comment = "占地面积")
	private BigDecimal areaSize;

	@Column(comment = "建筑面积")
	private BigDecimal buildSize;

	@Column(comment = "容积率")
	private BigDecimal volumeRate;

	@Column(comment = "绿化率")
	private BigDecimal greeningRate;

	@Column(comment = "产权年限")
	private String propertyYear;

	@Column(comment = "标签信息")
	private List<String> tags;

	@JSONField(serialize=false)
	@Column(comment="逻辑删除")
	private boolean deleted;

	@Column(comment="启用状态")
	private boolean enable;

	@Column(comment = "创建人")
	private String create_by;

	@Column(comment = "创建人")
	private String createUserId;

	@Column(comment = "创建人部门")
	private List<String> createDepartment;

	@Column(comment = "创建人部门的上级部门")
	private List<String> createChildDepartment;

	@UnSave
	private boolean parent_deleted;

    @UnSave
	private int deviceCount;  //门禁总数

    @UnSave
	private Map<String,Integer> deviceTypeCountMap = new HashMap<String,Integer>();  //类型下设备总数的封装

	@Column(comment = "展示状态")
	private boolean showInfo;

	public String getParent_id() {
		return parent_id;
	}

	public void setParent_id(String parent_id) {
		this.parent_id = parent_id;
	}

	public String getParent_name() {
		return parent_name;
	}

	public void setParent_name(String parent_name) {
		this.parent_name = parent_name;
	}

	public List<String> getParent_ids() {
		return parent_ids;
	}

	public void setParent_ids(List<String> parent_ids) {
		this.parent_ids = parent_ids;
	}

	public List<String> getEmployee_ids() {
		return employee_ids;
	}

	public void setEmployee_ids(List<String> employee_ids) {
		this.employee_ids = employee_ids;
	}

	public List<String> getEmployee_names() {
		return employee_names;
	}

	public void setEmployee_names(List<String> employee_names) {
		this.employee_names = employee_names;
	}

	public List<String> getArea_ids() {
		return area_ids;
	}

	public void setArea_ids(List<String> area_ids) {
		this.area_ids = area_ids;
	}

	public List<String> getArea_names() {
		return area_names;
	}

	public void setArea_names(List<String> area_names) {
		this.area_names = area_names;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getViewName() {
		return viewName;
	}

	public void setViewName(String viewName) {
		this.viewName = viewName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Integer getBuildNum() {
		return buildNum;
	}

	public void setBuildNum(Integer buildNum) {
		this.buildNum = buildNum;
	}

	public Integer getFamilyNum() {
		return familyNum;
	}

	public void setFamilyNum(Integer familyNum) {
		this.familyNum = familyNum;
	}

	public Integer getParkNum() {
		return parkNum;
	}

	public void setParkNum(Integer parkNum) {
		this.parkNum = parkNum;
	}

	public Integer getShopNum() {
		return shopNum;
	}

	public void setShopNum(Integer shopNum) {
		this.shopNum = shopNum;
	}

	public String getDeveloper() {
		return developer;
	}

	public void setDeveloper(String developer) {
		this.developer = developer;
	}

	public List<String> getPropertyType() {
		return propertyType;
	}

	public void setPropertyType(List<String> propertyType) {
		this.propertyType = propertyType;
	}

	public List<String> getBuildType() {
		return buildType;
	}

	public void setBuildType(List<String> buildType) {
		this.buildType = buildType;
	}

	public String getDecorationDesc() {
		return decorationDesc;
	}

	public void setDecorationDesc(String decorationDesc) {
		this.decorationDesc = decorationDesc;
	}

	public BigDecimal getAreaSize() {
		return areaSize;
	}

	public void setAreaSize(BigDecimal areaSize) {
		this.areaSize = areaSize;
	}

	public BigDecimal getBuildSize() {
		return buildSize;
	}

	public void setBuildSize(BigDecimal buildSize) {
		this.buildSize = buildSize;
	}

	public BigDecimal getVolumeRate() {
		return volumeRate;
	}

	public void setVolumeRate(BigDecimal volumeRate) {
		this.volumeRate = volumeRate;
	}

	public BigDecimal getGreeningRate() {
		return greeningRate;
	}

	public void setGreeningRate(BigDecimal greeningRate) {
		this.greeningRate = greeningRate;
	}

	public String getPropertyYear() {
		return propertyYear;
	}

	public void setPropertyYear(String propertyYear) {
		this.propertyYear = propertyYear;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public boolean isParent_deleted() {
		return parent_deleted;
	}

	public void setParent_deleted(boolean parent_deleted) {
		this.parent_deleted = parent_deleted;
	}

	public Map<String, Integer> getDeviceTypeCountMap() {
		return deviceTypeCountMap;
	}

	public void setDeviceTypeCountMap(Map<String, Integer> deviceTypeCountMap) {
		this.deviceTypeCountMap = deviceTypeCountMap;
	}

	public List<String> getTags() {
		return tags;
	}

	public void setTags(List<String> tags) {
		this.tags = tags;
	}

	@Override
	public String offerFieldName() {
		return "parent_id";
	}

	@Override
	public String offerTreeFieldName() {
		return "parent_ids";
	}

	public int getDeviceCount() {
		return deviceCount;
	}

	public void setDeviceCount(int deviceCount) {
		this.deviceCount = deviceCount;
	}



	public String getCreateUserId() {
		return createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	public List<String> getCreateDepartment() {
		return createDepartment;
	}

	public void setCreateDepartment(List<String> createDepartment) {
		this.createDepartment = createDepartment;
	}

	public List<String> getCreateChildDepartment() {
		return createChildDepartment;
	}

	public void setCreateChildDepartment(List<String> createChildDepartment) {
		this.createChildDepartment = createChildDepartment;
	}

	public String getCreate_by() {
		return create_by;
	}

	public void setCreate_by(String create_by) {
		this.create_by = create_by;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}

	public boolean isShowInfo() {
		return showInfo;
	}

	public void setShowInfo(boolean showInfo) {
		this.showInfo = showInfo;
	}
}
